/*
Created		26/08/2009
Modified		11/11/2010
Project		CIMa Planning
Model			Main
Company		CPIngredientes
Author		RGM
Version		0.1
Database		MS SQL 2000 
*/




Create table [monthly_distributions_per_plants_details]
(
	[purchase_order_version_id] Integer NOT NULL,
	[plant_version_id] Integer NOT NULL,
	[loop] Tinyint NOT NULL,
	[labeled] Tinyint NOT NULL,
	[quantity] Decimal(18,4) NOT NULL,
Primary Key ([purchase_order_version_id],[plant_version_id],[loop],[labeled])
) 
go


Alter table [monthly_distributions_per_plants_details] add  foreign key([purchase_order_version_id]) references [purchases_orders_versions] ([purchase_order_version_id])  on update no action on delete cascade 
go
Alter table [monthly_distributions_per_plants_details] add  foreign key([plant_version_id]) references [plants_versions] ([plant_version_id])  on update no action on delete cascade 
go


Set quoted_identifier on
go



Set quoted_identifier off
go


